<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/style/dl.css"/>
		<link rel="stylesheet" type="text/css" href="../bootstrap-3.3.5-dist/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/swiper.min.css"/>
		<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/iscroll.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/iscroll-probe.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/angular.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<!-- Button trigger modal -->


<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">提示</h4>
      </div>
      <div class="modal-body" id="modal-body">
			
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        
      </div>
    </div>
  </div>
</div>
		<div id="big">
			<header>
				淘宝账户登录
			</header>
			
			<main>
				<div>
					
					<div id="logo">
						<img src="../img/logo.png"/>
					</div>
					
					<div id="inputGroup">
						
						<div id="userName">
							<label for="userName">账户 : </label>
							<input type="text" placeholder="手机号/邮箱/会员号" id="user_name"/>
						</div>
						
						<div id="userPassword">
							<label for="userPassword">登录密码 : </label>
							<input type="password" placeholder="请输入密码" id="user_password"/>
						</div>
						
					</div>
					<button id="sign">登录</button>
					<div id="text">
						<a href="注册.html">免费注册</a>
						<a href="#">忘记密码</a>
					</div>
					
					
				</div>
			</main>
			
			

			
		</div>
	
	
	

	
	<script>
		
		(function(doc, win){
	        var docEl = doc.documentElement,
	            resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
	            recalc = function(){
	                var clientWidth = docEl.clientWidth;
	                if(!clientWidth) return;
	                docEl.style.fontSize = 100 * (clientWidth / 330) + 'px';
	            };
	        if(!doc.addEventListener) return;
	        win.addEventListener(resizeEvt, recalc, false);
	        doc.addEventListener('DOMContentLoaded', recalc, false);
	    })(document, window);
	    $('#myModal').on('shown.bs.modal', function () {
		  $('#myInput').focus()
		});
		$("#sign").click(function(){
			var Phone = $("#user_name").val();
			var Password = $("#user_password").val()
			$.ajax({
				type:"post",
				url:"http://47.92.37.168/supermarket/data/login.php",
				async:true,
				data:{
					user_phone:Phone,
					user_pass_word:Password
				},
				dataType : "jsonp",
				jsonp : "callback",
				jsonpCallback:"success_JsonpCallback",
				success : function(data){
					if(data.msg == "error"){
						$("#modal-body").text(data.reason);
						$('#myModal').modal()
					}else{
						console.log(data.info)
						alert(1)
						localStorage.setItem("name",$("#user_name").val())
						localStorage.setItem("addr",data.info.user_addr)
						localStorage.setItem("xm",data.info.user_name)
						location.href = "首页.html"
					}
				}
			});
		})
		    
		    
		    
	</script>
	</body>
</html>
